<?php
/**
 * Created By Project
 * Author: 陈东
 * Copyright：陈东
 * Source Code：陈东
 * Explain：I shall not authorize for any other commercial purposes, law breakers must be prosecuted.
 */
namespace Live\Widget;
use Live\Controller\BaseController;
use Think\Controller;
class LiveWidget extends BaseController {

	/*
	 * 显示收藏或已收藏
	 */
	public function showcollect($liveid){
		$userinfo = $_COOKIE['user_userinfo'];
		if(!empty($liveid)){
			$favorite = D(C('TABLE_FAVORITE'));
			$res = $favorite->where(array('user_token'=>$userinfo,'live_id'=>$liveid))->find();
			if($res){
				echo "<i class=\"online collect-icon\" style='color:#ff7200'>&#xe614;</i><br/><b>已收藏</b>";
			}else{
				echo "<i class=\"online collect-icon\" style='color:#858585'>&#xe60d;</i><br/><b>收藏</b>";
			}
		}

	}

	public function livestatus($livestarttime,$liveendtime){
		$time = date("Y-m-d H:i:m");
		if($time<$livestarttime){
			//直播未开始
			echo "未开始";
		}else if($time>$liveendtime){
			//直播已结束
			echo "已结束";
		}else if($time>=$livestarttime && $time<=$liveendtime){
			//正在直播
			echo "正在直播";
		}else{
			//其他状态
			echo "";
		}
	}

    
}
?>